<template>
  <el-container style="height: 100%;">
    <el-aside width="200px" style=" height: auto">
      <!--<div style="width: 200px;height:60px">-->
      <!--  <el-image :src="src" fit="scale-down" style="height: 60px;width: 60px;margin: 0px;float: left"></el-image>-->
      <!--  <div style="height:60px ;width: 140px;float: right;margin-top: 10%">xAPI&#45行为分析系统</div>-->
      <!--</div>-->
      <el-menu :default-openeds="['1', '5']" style="height: 100%;background-color: white;">
        <el-menu-item index="1-1" @click="goTo('/')">首页</el-menu-item>
        <el-menu-item index="1-2" @click="goTo('/dataIndex')">行为数据监控</el-menu-item>
        <el-menu-item index="1-3" @click="goTo('/searchTimes')">行为追踪</el-menu-item>
        <el-submenu index="2">
          <template slot="title"><i class="el-icon-setting"></i>资源管理与分析</template>
          <el-menu-item-group>
            <el-menu-item index="2-1" @click="goTo('/app/manager')">App管理</el-menu-item>
            <el-menu-item index="2-2" @click="goTo('/user/manager')">用户管理</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">注册表管理</template>
          <el-menu-item index="3-2-1" @click="goTo('/verb')">Verb</el-menu-item>
          <el-menu-item index="3-2-2" @click="goTo('/activity')">Activity</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>
    <el-main>
      <router-view/>
    </el-main>
  </el-container>
</template>
<script>
  export default{
    name: 'AppMain',
    data () {
      return {
        src: require('../../assets/headerlogo.png'),
        agent:JSON.parse(localStorage.getItem("agent"))
      }
    },
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },
      goTo(path) {
        this.$router.replace(path);
      }
    }
  }
</script>
